package com.info.zhiduoduo.repository.mapper.system;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Condition;
import com.info.zhiduoduo.repository.entity.system.SystemScheduleTask;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  系统定时任务表
 * Mapper 接口
 * </p>
 *
 * @author bob
 * @since 2021-11-29
 */
public interface SystemScheduleTaskMapper extends BaseMapper<SystemScheduleTask> {

	default SystemScheduleTask getByTaskName(String taskName) {
		return new SystemScheduleTask().selectOne(Condition.create().eq("task_name", taskName));
	}

	@Select(" select * from zdd_system_schedule_task where task_name like '%${name}%'")
	List<SystemScheduleTask> listByName(@Param("name") String name);

	@Select(" select * from zdd_system_schedule_task ")
	List<SystemScheduleTask> listAll();
}
